from django.db import models

# 分类
class Cagegory(models.Model):
    name=models.CharField(max_length=32)

    class Meta:
        db_table='category'



# 商品
class Goods(models.Model):
    title=models.CharField(max_length=32)
    price=models.DecimalField(max_digits=9,decimal_places=2)
    img=models.ImageField(upload_to='img')
    cate=models.ForeignKey('Cagegory',on_delete=models.CASCADE)
    class Meta:
        db_table='goods'



